/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ecouteurs;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.JCheckBox;
import javax.swing.JTextField;

/**
 *
 * @author Baptiste
 */
public class EcouteurRessources implements MouseListener{
    
    private JCheckBox afficher;
    private JCheckBox ramasser;
    private JTextField txtRessources;
    private JCheckBox ephemeres;
    
    public EcouteurRessources(JCheckBox ram, JCheckBox aff, JTextField txtRessources, JCheckBox ephemeres){
        this.ramasser = ram;
        this.afficher = aff;
        this.txtRessources = txtRessources;
        this.ephemeres = ephemeres;
    }

    public void mouseClicked(MouseEvent e) {
        if (!this.afficher.isSelected()){
            this.ramasser.setSelected(false);
            this.ramasser.setEnabled(false);
            this.txtRessources.setText("0");
            this.txtRessources.setEnabled(false);
            this.ephemeres.setSelected(false);
            this.ephemeres.setEnabled(false);
        }
        else{
            this.ramasser.setSelected(true);
            this.ramasser.setEnabled(true);
            this.txtRessources.setText("650");
            this.txtRessources.setEnabled(true);
            this.ephemeres.setSelected(true);
            this.ephemeres.setEnabled(true);
        }
    }

    public void mousePressed(MouseEvent e) {
    }

    public void mouseReleased(MouseEvent e) {
    }

    public void mouseEntered(MouseEvent e) {
    }

    public void mouseExited(MouseEvent e) {
    }

}
